<template>
  <div class="character-wrapper">
    <div class="character-blackhole">
      <div class="particles-container" ref="particlesRef"></div>
      <div class="event-horizon" :style="{ borderColor: `${character.color}40` }"></div>
      <div 
        class="blackhole-core"
        :style="{ 
          color: character.color, 
          textShadow: `0 0 10px ${character.color}80`,
          boxShadow: `0 0 30px 5px ${character.color}40, inset 0 0 20px rgba(0, 0, 0, 0.9), 0 0 60px 15px ${character.color}20`
        }"
      >
        {{ character.initials }}
      </div>
    </div>
    <div class="character-info">
      <div class="character-name">{{ character.name }}</div>
      <div class="character-description">{{ character.description }}</div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted, nextTick } from 'vue';
import { createParticles } from '@/utils/animations.js';

const props = defineProps({
  character: {
    type: Object,
    required: true
  }
});

const particlesRef = ref(null);

onMounted(() => {
  nextTick(() => {
    if (particlesRef.value) {
        createParticles(particlesRef.value, props.character.color);
    }
  });
});
</script>

<style scoped>
.character-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: all 0.3s ease;
  cursor: pointer;
}
</style>